# may be need https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz
# install ssl https://gitee.com/pandora/install/raw/master/openssl.sh
# ./configure --prefix=/usr/local/python --with-openssl=/usr/local/ssl
if which yum ; then
    yum install -y zlib-devel openssl-devel sqlite-devel bzip2-devel readline-devel gcc gcc-c++ libffi-devel xz-devel
else
    apt install build-essential checkinstall libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev libc6-dev libbz2-dev lzma-dev  libsqlite3-dev libreadline-dev libbz2-dev libffi-dev
fi
V=3.12.3
# wget https://www.python.org/ftp/python/$V/Python-$V.tar.xz
wget https://repo.huaweicloud.com/python/$V/Python-$V.tar.xz
tar xf Python-$V.tar.xz
cd Python-$V
if [ -e /usr/local/ssl ]; then  
    ./configure --prefix=/usr/local/python  --with-openssl=/usr/local/ssl | tee /tmp/py-config 
else 
    ./configure --prefix=/usr/local/python | tee /tmp/py-config 
fi
grep '_ssl... missing' /tmp/py-config && echo missing ssl && exit 1
# CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure --prefix=/usr/local/python
make && make install

ln -s /usr/local/python/bin/python3  /usr/local/bin
ln -s /usr/local/python/bin/pip3 /usr/local/bin
ln -s /usr/local/python/bin/python3-config /usr/local/bin

wget  https://bootstrap.pypa.io/get-pip.py
/usr/local/python/bin/python3 get-pip.py